package com.java110.mall.shop.cmd.community;

import com.alibaba.fastjson.JSONObject;
import com.java110.core.annotation.Java110Cmd;
import com.java110.core.context.ICmdDataFlowContext;
import com.java110.core.event.cmd.Cmd;
import com.java110.core.event.cmd.CmdEvent;
import com.java110.dto.community.CommunityDto;
import com.java110.intf.user.IWuyeV1InnerServiceSMO;
import com.java110.utils.exception.CmdException;
import com.java110.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 查询物业小区信息
 */
@Java110Cmd(serviceCode = "community.queryAdminCommunity")
public class QueryAdminCommunityCmd extends Cmd {

    @Autowired
    private IWuyeV1InnerServiceSMO wuyeV1InnerServiceSMOImpl;

    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
        super.validatePageInfo(reqJson);
        super.validateAdmin(context);
    }

    @Override
    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
        CommunityDto communityDto = new CommunityDto();
        communityDto.setState("1100"); //1100表示审核通过状态
        ResultVo result = wuyeV1InnerServiceSMOImpl.getCommunitys(reqJson);
        context.setResponseEntity(ResultVo.createResponseEntity(result));
    }
}
